
#define USE_8266
#include "Config.h"

void setup()
{
    Serial.begin(115200);
    auto &cfgMgr = CConfigMgr::getSingleton();
    if (cfgMgr.IsValid())
    {
        // put your setup code here, to run once:
        const char *data1 = "1234567890";
        cfgMgr.Clear();
        cfgMgr.SetData(1,data1, strlen(data1));
        cfgMgr.SaveConfig();
        Serial.println("生成配置数据");
    }
    else
    {
        Serial.println("读取配置数据");
    }
}

void loop()
{
    // put your main code here, to run repeatedly:
    auto &cfgMgr = CConfigMgr::getSingleton();
    std::vector<char> data1;
    cfgMgr.GetData(1,data1);
    Serial.println(data1.size());
    Serial.println(String(data1.data(),data1.size()));
    delay(10*1000);
}
